#include "PictureDisplayWindow.h"

PictureDisplayWindow::PictureDisplayWindow(Gdiplus::Image *img) :
DisplayWindow(L"Picture", img->GetWidth() + 16, img->GetHeight() + 39)
{
    this->img = img;
    create();
    g = new Gdiplus::Graphics(getWindowHandle());
    show();
}

PictureDisplayWindow::~PictureDisplayWindow()
{
    delete g;
}

void PictureDisplayWindow::on_paint()
{
    g->DrawImage(img, 0, 0);
}

void PictureDisplayWindow::on_quit()
{
    if (g != NULL)
    {
        delete g;
        g = NULL;
    }
    DisplayWindow::on_quit();
}